attribute vec3 a_positionL;
attribute vec3 a_normalL;
attribute vec2 a_uv;

uniform mat4 u_wvpMatrix;
uniform mat4 u_wMatrix;
uniform vec3 u_eyePosition;

varying vec3 v_normalW;
varying vec2 v_uv;
varying vec3 v_toEye;

void main()
{
	gl_Position = u_wvpMatrix * vec4(a_positionL, 1.0);
	
	v_normalW = normalize((u_wMatrix * vec4(a_normalL, 0.0)).xyz);
	v_uv = a_uv;
	v_toEye = normalize((u_wMatrix * vec4(a_positionL, 1.0) - vec4(u_eyePosition, 1.0)).xyz);
}
